package com.woniuxy.happylife.service.impl;

import com.woniuxy.happylife.dao.GoodsDao;
import com.woniuxy.happylife.entity.MallGoods;
import com.woniuxy.happylife.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author:roger
 * @Date:2022/2/17 15:35:56
 * @Description:
 */
@Service
public class GoodsServiceImpl implements GoodsService {
    @Resource
    GoodsDao goodsDao;
    @Override
    public List<MallGoods> findAll() {
        return goodsDao.findAll();
    }

    @Override
    public List<MallGoods> findByCid(int cid) {
        return goodsDao.findByCid(cid);
    }

    @Override
    public List<MallGoods> findNew() {
        return goodsDao.findNew();
    }

    @Override
    public Integer add(MallGoods goods) {
        return goodsDao.add(goods);
    }

    @Override
    public Integer updateStatusById(int gid) {
        return goodsDao.updateStatusById(gid);
    }

    @Override
    public MallGoods findById(int gid) {
        return goodsDao.findById(gid);
    }

    @Override
    public List<MallGoods> findByName(String name) {
        return goodsDao.findByName(name);
    }
}
